﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Routing;

namespace RuTracker.MVC
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}",
                defaults: new { controller = "Default", action = "Index" }
            );

            routes.MapRoute(
                name: "Authorize",
                url: "{controller}/{action}",
                defaults: new {controller = "Authorize", action = "Index"});

            routes.MapRoute(
               name: "Settings",
               url: "{controller}/{action}",
               defaults: new { controller = "Settings", action = "Index"}
           );

            routes.MapRoute(
                 name: "Settings_SelecteDropboxFolder",
                 url: "{controller}/{action}/{id}",
                 defaults: new { controller = "Settings", action = "SelecteDropboxFolder", id = ".*" }
             );

            routes.MapRoute(
                name: "Processing",
                url: "Processing/DownloadTorrentFileToDropboxFolder/{id}",
                defaults: new { controller = "Processing", action = "DownloadTorrentFileToDropboxFolder", id = UrlParameter.Optional }
            );

            routes.MapRoute(
               name: "Common",
               url: "{controller}/{action}/{id}",
               defaults: new { controller = "Common", action = "Error", id = UrlParameter.Optional }
           );
        }
    }
}